package com.ruoyi.shop.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.GoodsMapper;
import com.ruoyi.shop.domain.Goods;
import com.ruoyi.shop.service.IGoodsService;

/**
 * goodsService业务层处理
 *
 * @author ruoyi
 * @date 2025-06-05
 */
@Service
public class GoodsServiceImpl implements IGoodsService
{
    @Autowired
    private GoodsMapper goodsMapper;

    /**
     * 查询goods
     *
     * @param gid goods主键
     * @return goods
     */
    @Override
    public Goods selectGoodsByGid(Long gid)
    {
        return goodsMapper.selectGoodsByGid(gid);
    }

    /**
     * 查询goods列表
     *
     * @param goods goods
     * @return goods
     */
    @Override
    public List<Goods> selectGoodsList(Goods goods)
    {
        return goodsMapper.selectGoodsList(goods);
    }

    /**
     * 新增goods
     *
     * @param goods goods
     * @return 结果
     */
    @Override
    public int insertGoods(Goods goods)
    {
        return goodsMapper.insertGoods(goods);
    }

    /**
     * 修改goods
     *
     * @param goods goods
     * @return 结果
     */
    @Override
    public int updateGoods(Goods goods)
    {
        return goodsMapper.updateGoods(goods);
    }

    /**
     * 批量删除goods
     *
     * @param gids 需要删除的goods主键
     * @return 结果
     */
    @Override
    public int deleteGoodsByGids(Long[] gids)
    {
        return goodsMapper.deleteGoodsByGids(gids);
    }

    /**
     * 删除goods信息
     *
     * @param gid goods主键
     * @return 结果
     */
    @Override
    public int deleteGoodsByGid(Long gid)
    {
        return goodsMapper.deleteGoodsByGid(gid);
    }
}
